package adv8.server1;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author oldliu
 * @since 1.0
 */
public class LiuServer {
    public static void main(String[] args) {
        try {
            ServerSocket st=new ServerSocket(8888);
            System.out.println("服务器启动。。。");
            while (true){
                Socket s = st.accept();
                System.out.println("有人连接上了。。。"+s);
                System.out.println(s.getInetAddress()+":"+s.getPort());
                System.out.println(s.getLocalAddress()+":"+s.getLocalPort());

            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
